﻿<?php
session_start();
require_once('path.php');
require_once(SOJ_ROOT.'/include/function/lib.php');

if ( empty($_SESSION['admin']) ){
	//若用户还没有登录,则会重定向到首页
	header('Location:../manager/manager_login.php');
	exit ;
}

$request['admin'] = $_SESSION['admin'] ;
$PEAR_log = &Log::factory('file', 'soj.log', 'soj');

try{
	$admin_login_process = new admin_login_process( db_connect() , $request );

	if ( $admin_login_process->do_logout() ){

		//传递给sign_success页面的信息,
		//告诉用户退出登录成功
		$_SESSION['success_message'] = "Sign out success";
		header('Location:../manager/manager_login.php');
		exit ;

	}else{
		$_SESSION['fail_message'] = '注销失败' ;
		header('Location:../manager/manager_login.php');
		exit ;
	}

}catch(Exception $e){
	exception_handle( $e ) ;
}


